//
//  InputButtonView.swift
//  AirlineReservation
//
//  Created by Kevin on 2020/1/20.
//  Copyright © 2020 Kevin. All rights reserved.
//

import UIKit

class InputButtonView: UIButton {
    
    // 文本颜色
    var color:UIColor = COLOR_NICE
    // 文本位置
    var alignment:ContentHorizontalAlignment = .left
    
    override func draw(_ rect: CGRect) {
        let path = UIBezierPath()
        // 横线
        path.move(to: CGPoint(x: 0, y: rect.size.height))
        path.addLine(to: CGPoint(x: rect.size.width, y: rect.size.height))
        // 宽度
        path.lineWidth = 1
        // 文字显示左边
        contentHorizontalAlignment = alignment
        // 文本颜色
        setTitleColor(color, for: .normal)
        // 浅灰色
        UIColor.lightGray.setStroke()
        // 渲染
        path.stroke()
    }
}
